import 'package:xinxuan/vo/common_vo/common_pagination_vo.dart';

class GratitudesVo {

	List<List<GratitudesItem>>? data;
	GratitudesMeta? meta;

	GratitudesVo({this.data, this.meta});

	GratitudesVo.fromJson(Map<String, dynamic> json) {
		if (json['data'] != null) {
			data = <List<GratitudesItem>>[];
			json['data'].forEach((v) { 
        List<GratitudesItem> gratitudesItem = [];
        v.forEach((item) {
          gratitudesItem.add(GratitudesItem.fromJson(item));
        });
        data!.add(gratitudesItem); 
      });
		}
		meta = json['meta'] != null ? new GratitudesMeta.fromJson(json['meta']) : null;
	}
}

class GratitudesItem {
  String? title;
  String? totalAmount;
  String? createdAt;
  String? orderSn;
  String? progress;
  int? type;

  GratitudesItem(
      {this.title,
      this.totalAmount,
      this.createdAt,
      this.orderSn,
      this.progress,
      this.type});

  GratitudesItem.fromJson(Map<String, dynamic> json) {
    title = json['title'];
    totalAmount = json['total_amount'];
    createdAt = json['created_at'];
    orderSn = json['order_sn'];
    progress = json['progress'];
    type = json['type'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['title'] = this.title;
    data['total_amount'] = this.totalAmount;
    data['created_at'] = this.createdAt;
    data['order_sn'] = this.orderSn;
    data['progress'] = this.progress;
    data['type'] = this.type;
    return data;
  }
}

class GratitudesMeta {

	CommonPagination? pagination;
  Aggregates? aggregates;

	GratitudesMeta({this.pagination, this.aggregates});

	GratitudesMeta.fromJson(Map<String, dynamic> json) {
    aggregates = json['aggregates'] != null ? new Aggregates.fromJson(json['aggregates']) : null;
		pagination = json['pagination'] != null ? new CommonPagination.fromJson(json['pagination']) : null;
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.aggregates != null) {
      data['aggregates'] = this.aggregates!.toJson();
    }
		if (this.pagination != null) {
      data['pagination'] = this.pagination!.toJson();
    }
		return data;
	}
}

class Aggregates {
  String? balance;
  String? received;

  Aggregates({this.balance, this.received});

  Aggregates.fromJson(Map<String, dynamic> json) {
    balance = json['balance'];
    received = json['received'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['balance'] = this.balance;
    data['received'] = this.received;
    return data;
  }
}